package com.cdqidi.core.weixinmanager.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 微信公众平台管理
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_wx_org_wxconfig")
public class OrgWxConfig extends Model<OrgWxConfig> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "appid", type = IdType.NONE)
    private String appId;
    /**
     * 名称
     */
    @TableField("app_name")
    private String appName;
    /**
     * 令牌
     */
    @TableField("token")
    private String token;
    /**
     * 应用密钥
     */
    @TableField("app_secret")
    private String appSecret;
    /**
     * 消息是否加密
     */
    @TableField("encrypt_message")
    private Boolean encryptMessage;
    /**
     * 消息加解密密钥
     */
    @TableField("encode_aes_key")
    private String encodeAesKey;
    /**
     * 介绍
     */
    @TableField("remark")
    private String remark;
    /**
     * 安全文件
     */
    @TableField("security")
    private String security;
    /**
     * 安全文件名称
     */
    @TableField("security_file_name")
    private String securityFileName;
    /**
     * 商户号
     */
    @TableField("mch_id")
    private String mchId;
    /**
     * API秘钥
     */
    @TableField("api_key")
    private String apiKey;
    /**
     * 证书
     */
    @TableField("certificate")
    private String certificate;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
    /**
     * 微信账号分类
     */
    @TableField("wx_account_type")
    private String wxAccountType;
    /**
     * 机构ID
     */
    @TableField("org_id")
    private String orgId;
    /**
     * 操作人
     */
    @TableField("operator")
    private String operator;

    public void freeData() {
        this.appId = null;
        this.appName = null;
        this.token = null;
        this.appSecret = null;
        this.encryptMessage = null;
        this.encodeAesKey = null;
        this.remark = null;
        this.security = null;
        this.securityFileName = null;
        this.mchId = null;
        this.apiKey = null;
        this.certificate = null;
        this.addTime = null;
        this.updateTime = null;
        this.wxAccountType = null;
        this.orgId = null;
        this.operator = null;
    }

}
